﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="GoodsAdd.aspx.cs" Inherits="Manage_GoodsAdd" %>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>添加商品</title>
    <link href="../System/css.css" rel="stylesheet" type="text/css" />

    <script language="vbscript">
    	Function CheckForm()
		Dim bolSubmit
		bolSubmit = True
		Dim txtInput
		dim i
		dim j
		dim str
		dim str1
		
		Set txtInput = document.all("tabData").all.tags("Input")
		If Len(document.all("txtGoodsInstruction").value) > 0 Then
			If InStr (document.all("txtGoodsInstruction").value,"'") >0Then
				msgbox "“ 商品说明 ”含有非法字符 ' 请重新输入！",16,"修改档案"
				document.all("txtGoodsInstruction").select()
				document.all("txtGoodsInstruction").focus()						
				CheckForm = False
			End If				
		End If
	    For i = 0 To txtInput.length - 1
		    If IsNull(txtInput(i).getAttribute("NumericOnly")) = False Then
			    If Len(txtInput(i).value) > 0 Then
				    If IsNumeric(txtInput(i).value) = False Then
					    msgbox "“" & txtInput(i).getAttribute("NumericOnly") & "”必须输入数字！",16,"修改档案"
					    txtInput(i).select()
					    txtInput(i).focus()
					    bolSubmit = False
					    CheckForm = False
					    Exit For
				    End If
			    End If
		    End If
		    
		      If IsNull(txtInput(i).getAttribute("QJZBJ")) = False Then
			        If Len(txtInput(i).value) > 0 Then			        
			                If IsNumeric(txtInput(i).value) = True Then
			                    For j=1 to len(txtInput(i).value) 
			                        str1=Asc(mid(txtInput(i).value,j,1))
			                       
			                        If  str1 < 0 Then
			                            str=str&chr(str1+23680)
				 	                    txtInput(i).select()
					                    txtInput(i).focus()
					                Else
					                   str=str&chr(str1)
					                End If
					            Next
					            
					            IF Asc(txtInput(i).value) < 0 Then
					                msgbox "“" & txtInput(i).getAttribute("QJZBJ") & "”输入了全角已转为半角,请再次点击保存！",16,"修改档案"
					                bolSubmit = False
					                CheckForm = False
					            End If
					            txtInput(i).value=str
					        End If
				    End If
		    End If
		    
		      If IsNull(txtInput(i).getAttribute("DYL")) = False Then
			        If Len(txtInput(i).value) > 0 Then			        
			                If IsNumeric(txtInput(i).value) = True Then	
				                If (InStr(txtInput(i).value,"-") <>0 or Mid(txtInput(i).value,1,1)="0") Then
				 	                msgbox "“" & txtInput(i).getAttribute("DYL") & "”必须大于零！",16,"修改档案"
					                txtInput(i).select()
					                txtInput(i).focus()
					                bolSubmit = False
					                CheckForm = False
					                Exit For
                                End If
				            End If
				    End If
		    End If
		    
		    
		    If IsNull(txtInput(i).getAttribute("ZS")) = False Then
			        If Len(txtInput(i).value) > 0 Then			        
			                If IsNumeric(txtInput(i).value) = True Then	
				                If InStr(txtInput(i).value,".") <>0 Then
				 	                msgbox "“" & txtInput(i).getAttribute("ZS") & "”必须是整数！",16,"修改档案"
					                txtInput(i).select()
					                txtInput(i).focus()
					                bolSubmit = False
					                CheckForm = False
					                Exit For
                                End If
				            End If
				    End If
		    End If
		    
		    If IsNull(txtInput(i).getAttribute("NotNull")) = False Then
			    If Len(Trim(txtInput(i).value)) = 0 Then
				    msgbox "“" & txtInput(i).getAttribute("NotNull") & "”必须输入！",16,"警告"
				    txtInput(i).select()
				    txtInput(i).focus()
				    bolSubmit = False
				    CheckForm = False
				    Exit For
			    End If
		    End If
		    If IsNull(txtInput(i).getAttribute("DateTimeOnly")) = False Then
			    If Len(txtInput(i).value) > 0 Then
				    If IsDate(txtInput(i).value) = False Then
					    msgbox "“" & txtInput(i).getAttribute("DateTimeOnly") & "”必须输入日期！",16,"修改档案"
					    txtInput(i).select()
					    txtInput(i).focus()
					    bolSubmit = False
					    CheckForm = False
					    Exit For
				    End If
			    End If
		    End If

		    If IsNull(txtInput(i).getAttribute("InvertedComma")) = False Then
			    If Len(txtInput(i).value) > 0 Then
				    If InStr (txtInput(i).value,"'") >0Then
					    msgbox "“" & txtInput(i).getAttribute("InvertedComma") & "”含有非法字符 ' 请重新输入！",16,"修改档案"
					    txtInput(i).select()
					    txtInput(i).focus()
					    bolSubmit = False
					    CheckForm = False
					    Exit For
				    End If
			    End If
		    End If
	    Next
		
	End Function
	
    </script>

    <script language="javascript">

        function Sel() {
            //  window.alert("11");
            window.open('GoodsAdd_CompanySearch.aspx');
        }
        function confirmvalue(obj) {
            document.all("txtIsSalerId").value = obj.companyid;
            document.all("txtCompany").value = obj.companyName;
        }
        function Sel_dl() {
            //  window.alert("11");
            window.open('GoodsAdd_CompanySearch_dl.aspx');
        }
        function confirmvalue_dl(obj) {

            document.all("txtIsSalerId_dl").value = obj.companyid;
            document.all("txtCompany_dl").value = obj.companyName;
        }
        function chk() {


            if (document.all("chkIsImport").checked == false) {
                table1.style.display = 'none';
            }
            else {
                table1.style.display = 'block';
            }
        }
        function rdoLevels() {
            var delflag;
            var a = document.getElementsByName('rdoQualityLevels');
            var b = document.getElementById('Label1');
            if (a[1].checked == true) {
                b.innerHTML = '指取得中华人民共和国知识产权局认证的处于中国药品物质专利保护期内或处在国家药监局规定的行政保护期内的药品。生产企业应递交有效专利或行政保护证明文件，政府定价类药品，同时还必须提供有效的国家发改委定价文件。';

            }
            if (a[2].checked == true) {
                b.innerHTML = '指过了发明国物质专利保护期的药品。生产企业应递交专利证明文件，政府定价药品，还应递交有效的国家发改委原研定价证明文件。';
            }
            if (a[3].checked == true) {
                b.innerHTML = '是指国家发改委单独定价的药品，投标人应递交有效的国家发改委单独定价文件。';
            }
            if (a[4].checked == true) {
                b.innerHTML = '国家发改委定价为优质优价的中成药。';
            }
            if (a[5].checked == true) {
                b.innerHTML = '为通过GMP认证生产企业生产的药品，投标人应递交有效的国家食品药品监督管理部门颁发的GMP证书。';
            }

        }
    </script>

</head>
<body>
    <form id="Form1" runat="server">

    <script language="javascript" src="../common/javascript/calendar.js" type="text/javascript"></script>

    <div>
        <table width="98%" border="0" align="center" cellpadding="0" cellspacing="0">
            <tr>
                <td style="width: 4px">
                    <img src="../images/intro_left.gif" width="4" height="34">
                </td>
                <td class="intro_wordbg">
                    添加商品
                </td>
                <td background="../images/intro_bg.gif">
                    <img src="../images/intro_right.jpg" width="118" height="34">
                </td>
            </tr>
        </table>
        <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" class="table_table2">
            <tr>
                <td class="table_td3" style="height: 24px">
                    品目号
                </td>
                <td class="table_td2" style="height: 24px">
                    <asp:Label ID="labProductCode" runat="server" Text="" Width="185px"></asp:Label>
                </td>
                <td class="table_td3" style="height: 24px">
                    通用名：
                </td>
                <td class="table_td2" style="height: 24px">
                    <asp:Label ID="labProductName" runat="server" Text="" Width="197px"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="table_td3">
                    剂型：
                </td>
                <td class="table_td2">
                    <asp:Label ID="labMedicinemodel" runat="server" Text="" Width="185px"></asp:Label>
                </td>
                <td class="table_td3">
                    规格：
                </td>
                <td class="table_td2">
                    <asp:Label ID="labOutlookc" runat="server" Text="" Width="196px"></asp:Label>
                </td>
            </tr>
            <tr>
                <td class="table_td3">
                    单位：
                </td>
                <td class="table_td2">
                    <asp:Label ID="labUnit" runat="server" Text="" Width="185px"></asp:Label>
                </td>
                <td class="table_td3">
                    转换系数：
                </td>
                <td class="table_td2">
                    <asp:Label runat="server" ID="txtFactor" Width="195px"></asp:Label>
                </td>
            </tr>
        </table>
        <table id="tabData" width="98%" border="0" align="center" cellpadding="2" cellspacing="1"
            class="table_table2">
            <tr>
                <td class="table_td3">
                    企业商品说明书名称：
                </td>
                <td class="table_td2">
                    <asp:TextBox ID="txtProductNameSM" runat="server" InvertedComma="企业商品说明书名称" NotNull="企业商品说明书名称"
                        Width="190px"></asp:TextBox><span style="color: #ff0000">(*)按商品说明书上的药品名称填写。必须要和商品说明书上的名字一致。</span>
                </td>
            </tr>
            <tr>
                <td class="table_td3">
                    生产企业：
                </td>
                <td class="table_td2">
                    <asp:TextBox ID="txtCompany" runat="server" Width="415px" NotNull="生产企业" ReadOnly="true"></asp:TextBox>
                    <input id="Button1" type="button" value="选择生产企业" class="button_bg6" onclick='Sel()'
                        style="width: 90px" /><span style="color: #ff0000">(*)</span>
                    <input id="Hidden1" name="txtIsSalerId" type="hidden" style="width: 73px" />
                </td>
            </tr>
            <tr>
                <td class="table_td3">
                    批准文号：
                </td>
                <td class="table_td2">
                    <asp:TextBox runat="server" ID="txtLicenseNumber" InvertedComma="批准文号" Width="415px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="table_td3" style="height: 28px">
                    批准文号有效期：
                </td>
                <td class="table_td2" style="height: 28px">
                    <asp:TextBox runat="server" ID="txtLicenseNumberDate" onclick="javascript:fPopCalendar(txtLicenseNumberDate,txtLicenseNumberDate);"
                        dataType="Date" format="ymd" require="true" DateTimeOnly="批准文号有效期" Width="415px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="table_td3">
                    是否进口药
                </td>
                <td class="table_td2">
                    <asp:CheckBox ID="chkIsImport" Text="是" runat="server" onclick="javascript:chk();" /><br />
                    <table id="table1" style="display: none">
                        <tr>
                            <td colspan="2">
                                <asp:TextBox ID="txtCompany_dl" ReadOnly="true" runat="server" Width="415px"></asp:TextBox>
                                <input id="Button3" type="button" value="选择一级代理商" class="button_bg6" onclick='Sel_dl()'
                                    style="width: 89px" />
                                <input id="Hidden2" name="txtIsSalerId_dl" type="hidden" style="width: 38px" />
                            </td>
                        </tr>
                        <tr>
                            <td class="table_td3">
                                进口药品注册证号：
                            </td>
                            <td class="table_td2">
                                <asp:TextBox runat="server" ID="txtImportCode" InvertedComma="进口药品注册证号" Width="415px"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="table_td3">
                                进口药品注册证有效期限：
                            </td>
                            <td class="table_td2">
                                <asp:TextBox runat="server" ID="txtImportRegistDate" onclick="javascript:fPopCalendar(txtImportRegistDate,txtImportRegistDate);"
                                    dataType="Date" format="ymd" require="true" DateTimeOnly="进口药品注册证有效期限" Width="415px"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="table_td3">
                    商品名：
                </td>
                <td class="table_td2">
                    <asp:TextBox runat="server" ID="txtGoodsName" InvertedComma="商品名" Width="415px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="table_td3" style="height: 28px">
                    材 质：
                </td>
                <td class="table_td2" style="height: 28px">
                    <asp:TextBox runat="server" ID="txtMaterial" InvertedComma="材 质" Width="415px"></asp:TextBox>
                    <asp:TextBox runat="server" ID="txtPackUnit" InvertedComma="包装单位" Width="48px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="table_td3">
                    最新零售价：
                </td>
                <td class="table_td2">
                    <asp:TextBox runat="server" ID="txtRetailPrice" NumericOnly="零售价" Width="415px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="table_td3">
                    零售价出处：
                </td>
                <td class="table_td2">
                    <asp:TextBox runat="server" ID="txtMemo4" InvertedComma="零售价出处" Width="415px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="table_td3">
                    药品质量层次：
                </td>
                <td class="table_td2">
                    <asp:RadioButtonList ID="rdoQualityLevels" runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Text="普通GMP药品" Value="0" Selected="True"></asp:ListItem>
                        <asp:ListItem Text="专利药品" Value="1"></asp:ListItem>
                        <asp:ListItem Text="1999年以来获得国家科学技术奖的药品" Value="2"></asp:ListItem>
                        <asp:ListItem Text="国家一类新药" Value="3"></asp:ListItem>
                        <asp:ListItem Text="原研制药品" Value="4"></asp:ListItem>
                        <asp:ListItem Text="单独定价药品" Value="5"></asp:ListItem>
                        <asp:ListItem Text="优质优价中成药" Value="6"></asp:ListItem>
                        <asp:ListItem Text="全国医药工业百强企业的药品" Value="7"></asp:ListItem>
                        <asp:ListItem Text="中药保护品种" Value="8"></asp:ListItem>
                        <asp:ListItem Text="欧美认证药品" Value="9"></asp:ListItem>
                    </asp:RadioButtonList>
                    &nbsp;
                    <asp:Label ID="Label1" runat="server" Text="为通过GMP认证生产企业生产的药品，投标人应递交有效的国家食品药品监督管理部门颁发的GMP证书。"></asp:Label>
                </td>
            </tr>
            <!--                
<tr>
                    <td class="table_td3">
                        gmp 认证编号：

                    </td>
                    <td class="table_td2">
                        <asp:TextBox runat="server" ID="txtGmpCode"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="table_td3">
                        gmp认证范围：

                    </td>
                    <td class="table_td2">
                        <asp:TextBox runat="server" ID="txtGmpRange"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="table_td3">
                        Gmp发证日期：

                    </td>
                    <td class="table_td2">
                        <asp:TextBox runat="server" ID="txtGmpDate" onclick="javascript:fPopCalendar(txtGmpDate,txtGmpDate);"
                        dataType="Date" format="ymd" require="true"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="table_td3">
                        Gmp有效期限：

                    </td>
                    <td class="table_td2">
                        <asp:TextBox runat="server" ID="txtGmpValDate" onclick="javascript:fPopCalendar(txtGmpValDate,txtGmpValDate);"
                        dataType="Date" format="ymd" require="true"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="table_td3">
                        药品许可证号：

                    </td>
                    <td class="table_td2">
                        <asp:TextBox runat="server" ID="txtLicence"></asp:TextBox>
                    </td>
                </tr>
                <tr>
                    <td class="table_td3">
                        药品许可证有效期：

                    </td>
                    <td class="table_td2">
                        <asp:TextBox runat="server" ID="txtLicenceDate" onclick="javascript:fPopCalendar(txtLicenceDate,txtLicenceDate);"
                        dataType="Date" format="ymd" require="true"></asp:TextBox>
                    </td>
                </tr>
                                <tr>
                    <td class="table_td3">
                        是否原研药</td>
                    <td class="table_td2">
                        <asp:CheckBox ID="chkIsPrimitive" Text="是" runat="server" /></td>
                </tr>

                <tr>
                    <td class="table_td3">
                        有无新药证书</td>
                    <td class="table_td2">
                        <asp:CheckBox ID="chkIsNewMedicine" runat="server" Text="有" />
                        <table style="width: 295px">
                            <tr>
                                <td class="table_td3">
                                    <asp:Label ID="Label3" runat="server" Text="新药证书："></asp:Label></td>
                    <td class="table_td2">
                                    <asp:TextBox ID="txtNewMedicine" runat="server"></asp:TextBox></td>
                            </tr>
                            <tr>
                                <td class="table_td3">
                                    <asp:Label ID="Label4" runat="server" Text="新药证书有效期：" Width="132px" ></asp:Label></td>
                    <td class="table_td2">
                                    <asp:TextBox ID="txtNewMedicineDate" runat="server" onclick="javascript:fPopCalendar(txtNewMedicineDate,txtNewMedicineDate);"
                        dataType="Date" format="ymd" require="true"></asp:TextBox></td>
                            </tr>
                        </table>
                    </td>
                </tr>-->
            <tr>
                <td class="table_td3">
                    有无药品检验报告：
                </td>
                <td class="table_td2">
                    <asp:CheckBox ID="chkIsSurveyReport" runat="server" Text="有" /><br />
                    <table width="98%">
                        <tr>
                            <td class="table_td3">
                                药品检验报告编号：
                            </td>
                            <td class="table_td2">
                                <asp:TextBox ID="txtSurveyReportId" runat="server" Width="415px" InvertedComma="药品检验报告编号"></asp:TextBox>
                            </td>
                        </tr>
                        <tr>
                            <td class="table_td3">
                                药品检验报告有效期：
                            </td>
                            <td class="table_td2">
                                <asp:TextBox ID="txtSurveyReportDate" runat="server" Width="415px" onclick="javascript:fPopCalendar(txtSurveyReportDate,txtSurveyReportDate);"
                                    dataType="Date" format="ymd" require="true" DateTimeOnly="药品检验报告有效期"></asp:TextBox>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td class="table_td3">
                    商品说明
                </td>
                <td class="table_td2">
                    <asp:TextBox ID="txtGoodsInstruction" runat="server" Height="123px" TextMode="MultiLine"
                        Width="415px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td class="table_td2">
                    <asp:Button ID="BtnSave" runat="server" Text="保　存" OnClick="BtnSave_Click" CssClass="button_bg"
                        OnClientClick="javascript:return CheckForm();" />
                </td>
                <td class="table_td2">
                    <input id="Button4" class="button_bg" name="sdf" type="button" value="关  闭" onclick="window.close()" />
                </td>
            </tr>
        </table>
    </div>
    <asp:HiddenField ID="hidProductId" runat="server" />
    </form>
</body>
</html>
